﻿
Partial Class includes_Default
    Inherits System.Web.UI.Page

    Sub userLogin()

        Dim userLogin, userPassword As String

        Dim myLogin As String = Request.QueryString("login")
        Dim myPassword As String = Request.QueryString("password")

        Dim file As String = "xml_users.xml"

        Dim xml = Server.CreateObject("Microsoft.XMLDOM")
        xml.async = False
        xml.load(Server.MapPath(file))


        Dim counter = xml.documentElement.childNodes.length

        For i = 0 To (counter - 1)

            userLogin = xml.documentElement.childNodes(i).attributes.getNamedItem("login").nodeValue
            userPassword = xml.documentElement.childNodes(i).attributes.getNamedItem("password").nodeValue


            If myLogin = userLogin Then
                If myPassword = userPassword Then

                    Session("AccessLevel") = xml.documentElement.childNodes(i).attributes.getNamedItem("role").nodeValue
                    Session("Wallpaper") = xml.documentElement.childNodes(i).attributes.getNamedItem("wallpaper").nodeValue

                End If
            End If
        Next

    End Sub
End Class
